import request from '@/config/axios'

export interface NotifyVO {
  id: number
  title: string
  content: string
  type: number
  status: number
}

export function useNotifyApi() {
  return {
    // 查询notify列表
    getNotifyPage: async (params: PageParam) => {
      return await request.get({url: '/yxt/notify/page', params})
    },

    // 查询notify列表
    getNotifyList: async (params: PageParam) => {
      return await request.get({url: '/yxt/notify/get-simple-list', params})
    },

    // 删除notify
    deleteNotify: async (id: number) => {
      return await request.delete({url: '/yxt/notify/delete?id=' + id})
    },

    // 查询Notify
    getNotify: async (id: number) => {
      return await request.get({url: '/yxt/notify/get?id=' + id})
    },

    // 创建Notify
    createNotify: (data: NotifyVO) => {
      return request.post({url: '/yxt/notify/create', data})
    },

    // 更新Notify
    updateNotify: (data: NotifyVO) => {
      return request.post({url: '/yxt/notify/update', data})
    },
  }
}
